wp=$(docker images wordpress:latest | awk '{print $1}'| sed -n '2p')
if [[ $wp == "wordpress" ]];then
    echo "已下载"
else
    echo "没有搜索到镜像正在下载........."
    docker pull wordpress:latest
fi

mysql=$(docker images mysql:5.7 | awk '{print $1}'| sed -n '2p')
if [[ ${mysql} == "mysql" ]];then
    echo "已下载"
else
    echo "没有搜索到镜像正在下载........."
    docker pull mysql:5.7
fi

docker login 192.168.27.136 -u admin -p admin

docker tag wordpress 192.168.27.136/1802a/wg/wp
docker push 192.168.27.136/1802a/wg/wp

docker tag mysql:5.7 192.168.27.136/1802a/wg/mysql:5.7
docker push 192.168.27.136/1802a/wg/mysql:5.7

ansible-playbook /root/jenkins/wp.yml
